
/**
 * AppleIIGo
 * Ensoniq DOC (Digital Oscillator Chip) class
 * (C) 2008 by Marc S. Ressl (mressl@umich.edu)
 * Released under the GPL
 */
 
#include "Motherboard.h"

#ifndef DOC_H
#define DOC_H

#define SOUNDCONTROL_ADDRAUTOINC	(1 << 5)
#define SOUNDCONTROL_DOCACCESS		(1 << 6)
#define SOUNDCONTROL_DOCBUSY		(1 << 7)

class DOC : public Device {
public:
	DOC(class Motherboard * motherboard);
	
	void writeAudio(UINT32 audioBufferSampleNum);
	void readAudio(UINT32 audioBufferSampleNum);
	
	void setControlRegister(UINT8 value);
	UINT8 getControlRegister();
	void sendData(UINT8 value);
	UINT8 receiveData();
	void setAddressLow(UINT8 value);
	UINT8 getAddressLow();
	void setAddressHigh(UINT8 value);
	UINT8 getAddressHigh();
	
private:
	SINT32 * sampleInputBuffer;
	SINT32 * sampleOutputBuffer;
	UINT32 sampleRate;
	
	UINT8 controlRegister;
	UINT16 address;
};

#endif
